<?php
namespace App\Providers;

use App\Models\System;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;

/**
 * Twoir CMS系统 twCMS
 *
 * (c) cighsen02 <xiayu@959602.com>
 *
 * Create at：2024.10.14
*/
class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        //
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        // 系统配制缓存
        Schema::hasTable('systems') && view()->share('systemConfig', System::getAllWithCache());
    }
}
